package cn.wolfcode.rbac.domain;

import java.util.ArrayList;
import java.util.List;

public class Role extends BaseDomain {
    private String name;
    private String sn;
    //用来封装权限信息
    private List<Permission> permissions = new ArrayList<>();
    //增加角色-权限表的映射关系
    public void setPermissions(List<Permission> permissions){
        this.permissions = permissions;
    }

    public List<Permission> getPermissions(){
        return this.permissions;
    }

    public Role(Long id, String name, String sn) {
        super(id);
        this.name = name;
        this.sn = sn;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSn() {
        return sn;
    }

    public void setSn(String sn) {
        this.sn = sn;
    }

    @Override
    public String toString() {
        return "Role{" +
                "name='" + name + '\'' +
                ", sn='" + sn + '\'' +
                ", id=" + id +
                '}';
    }
}
